package com.twu.bibilioteca;

import org.junit.Test;

import static junit.framework.Assert.assertEquals;

/**
 * Created by IntelliJ IDEA.
 * User: dixithk
 * Date: 6/19/14
 * Time: 6:06 PM
 * To change this template use File | Settings | File Templates.
 */
public class ReturnBookTest {

    Library lib =new Library();
    @Test
    public void shouldCheckForSuccessfullReturn()
    {
       new CheckOutBook(new UserInterfaceTest("program in C") , lib).action();
        Result returnResult= new ReturnBook(new UserInterfaceTest("program in C") , lib).action();

        assertEquals(new Result("Thank you for returning the book.", true) ,returnResult ) ;
    }

    @Test
    public void shouldCheckForUnSuccessfullReturn()
    {

        Result returnResult= new ReturnBook(new UserInterfaceTest("program in C") , lib).action();

        assertEquals(new Result("That is not a valid book to return." , false) ,returnResult ) ;
    }

    @Test

    public void shouldCheckJobOfClass()
    {
        new ReturnBook(new UserInterfaceApp(), lib).getName();
    }
}

